package city.spring.modules.material.service;

import city.spring.modules.material.entity.MaterialwarehousingMaterialExtEntity;
import city.spring.modules.material.vo.MaterialwarehousingMaterialVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Service：物资入库与货架关联
 *
 * @author 谢金婷
 * @date 2020-07-17 11:44:42
 */
public interface MaterialwarehousingMaterialExtService extends IService<MaterialwarehousingMaterialExtEntity> {
    String CACHE_NAME = "materialwarehousing_material_ext";

    /**
     * 业务处理：保存一个 <strong>物资入库与货架关联</strong>
     *
     * @param entity 物资入库与货架关联
     */
    void saveMaterialwarehousingMaterialExt(MaterialwarehousingMaterialExtEntity entity);

    /**
     * 业务处理：修改一个 <strong>物资入库与货架关联</strong>
     *
     * @param entity 物资入库与货架关联
     */
    void updateMaterialwarehousingMaterialExt(MaterialwarehousingMaterialExtEntity entity);

    /**
     * 业务处理：删除一个 <strong>物资入库与货架关联</strong>
     *
     * @param primaryKey 主键ID
     */
    void deleteMaterialwarehousingMaterialExt(String primaryKey);

    /**
     * 业务处理：删除多个 <strong>物资入库与货架关联</strong>
     *
     * @param primaryKeys 主键ID列表
     */
    void deleteMaterialwarehousingMaterialExt(List<String> primaryKeys);

    /**
     * 根据物资id查找入库物资
     *
     * @param materialId
     * @return
     */
    IPage<MaterialwarehousingMaterialExtEntity> getByMaterialId(Page<? extends MaterialwarehousingMaterialExtEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MaterialwarehousingMaterialExtEntity> wrapper, String materialId);

    /**
     * 获取入库的物资列表
     *
     * @param materialwarehousingId 入库单ID
     * @return
     */
    List<MaterialwarehousingMaterialVO> getWarehousingMaterials(String materialwarehousingId);

    IPage<MaterialwarehousingMaterialExtEntity> getMaterialWarehouseList(Page<? extends MaterialwarehousingMaterialExtEntity> page, String storehouseId, String materialId);
}